package com.dstats.data;

import android.content.ContentUris;
import android.net.Uri;
import android.provider.BaseColumns;

/**
 * Created by MeSeems - Note 1 on 22/01/2015.
 */
public class AppDataContract {

    public static final String DATABASE_NAME = "dstats_app";
    public static final int DATABASE_VERSION = 2;

    public static final String CONTENT_AUTHORITY = "com.dstats";
    public static final Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY);

    public static final String PATH_HERO = "hero";
    public static final String PATH_HERO_ROLES = "heroRoles";

    public static class AppHeroEntry implements BaseColumns {
        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_HERO).build();
        public static final String TABLE_NAME = "Heroes";
        public static final String NAME = "name";
        public static final String LOCALIZED_NAME = "localizedName";
        public static final String BIO = "bio";
        public static final String ATK = "atk";
        public static final String ATK1 = "atk1";

        public static Uri buildUri(long id) {
            return ContentUris.withAppendedId(CONTENT_URI, id);
        }
    }

    public static class AppHeroRolesEntry {
        public static final Uri CONTENT_URI = BASE_CONTENT_URI.buildUpon().appendPath(PATH_HERO_ROLES).build();
        public static final String TABLE_NAME = "HeroRoles";
        public static final String ROLE = "role";
        public static final String HERO_ID = "heroId";


        public static Uri buildUri(long id) {
            return ContentUris.withAppendedId(CONTENT_URI, id);
        }
    }
}
